package cdu.notFound.service.impl;

import cdu.notFound.Dao.GoodsDao;
import cdu.notFound.Dao.impl.GoodsDaoImpl;
import cdu.notFound.model.Goods;
import cdu.notFound.service.GoodsService;
import cdu.notFound.utils.IntHolder;

import java.util.List;

public class GoodsServiceImpl implements GoodsService {

    GoodsDao  goodsDao = new GoodsDaoImpl();

    @Override
    public Goods findById(int id) {
        return goodsDao.findById(id);
    }

    @Override
    public boolean doCreate(Goods good) {
        return goodsDao.doCreate(good);
    }

    @Override
    public int getMaxId() {
        return goodsDao.getMaxId();
    }

    @Override
    public List<Goods> findAll(IntHolder num, int limitMin, int perPage) {
        return goodsDao.findAll(num,limitMin,perPage);
    }

    @Override
    public List<Goods> findAllNotAuditing() {
        return goodsDao.findAllNotAuditing();
    }

    @Override
    public boolean doUpdate(Goods good) {
        return goodsDao.doUpdate(good);
    }

    @Override
    public List<Goods> findByCeta(int cetaId, IntHolder num, int limitMin, int perPage) {
        return goodsDao.findByCeta(cetaId,num,limitMin,perPage);
    }

    @Override
    public List<Goods> findByKey(String key) {
        return goodsDao.findByKey(key);
    }

    @Override
    public List<Goods> findByUserId(int userId) {
        return goodsDao.findByUserId(userId);
    }
}
